using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;

namespace Stormwind.Testing.Entities {
	/// <summary>
	/// Order of a customer.
	/// </summary>
	[ActiveRecord]
	public class OrderItem{
		private Int32 id;
		private DateTime date;
		private Double _value;
		private Customer customer;

		/// <summary>
		/// Order Id.
		/// </summary>
		[PrimaryKey(PrimaryKeyType.Native)]
		public Int32 Id {
			get { return id; }
			set { id = value; }
		}

		/// <summary>
		/// Date of the order.
		/// </summary>
		[Property]
		public DateTime Date {
			get { return date; }
			set { date = value; }
		}

		/// <summary>
		/// Value of the order.
		/// </summary>
		[Property]
		public Double Value {
			get { return _value; }
			set { _value = value; }
		}

		/// <summary>
		/// Customer Id.
		/// </summary>
		[BelongsTo("CustomerId", NotNull = true)]
		public Customer Customer {
			get { return customer; }
			set { customer = value; }
		}

	}
}
